package com.jsm.twentyfour.transfer;

import com.jsm.twentyfour.domain.Account;
import com.jsm.twentyfour.dto.AccountDTO;
import com.kejin.util.autoCoding.CU;

/**
 * create by jsm on 2019/1/23
 */
public class AccountTransfer {
    public static void main(String[] args) {
        CU.d(Account.class, AccountDTO.class);
        CU.d(AccountDTO.class, Account.class);
    }
    public static AccountDTO transfer(Account account){
        if(account==null){
            return null;
        }
        AccountDTO accountDTO = new AccountDTO();
        accountDTO.setUpdateAt(account.getUpdateAt());
        accountDTO.setCreateAt(account.getCreateAt());
        accountDTO.setHeadImage(account.getHeadImage());
        accountDTO.setGender(account.getGender());
        accountDTO.setId(account.getId());
        accountDTO.setOpenId(account.getOpenId());
        accountDTO.setNickname(account.getNickname());
        return accountDTO;
    }





    public static Account transfer(AccountDTO accountDTO){
        if(accountDTO==null){
            return null;
        }
        Account account = new Account();
        account.setUpdateAt(accountDTO.getUpdateAt());
        account.setCreateAt(accountDTO.getCreateAt());
        account.setHeadImage(accountDTO.getHeadImage());
        account.setGender(accountDTO.getGender());
        account.setId(accountDTO.getId());
        account.setOpenId(accountDTO.getOpenId());
        account.setNickname(accountDTO.getNickname());
        return account;
    }


}
